const TransformPages = require('uni-read-pages')
const getTabBar = require('./getTabBar.js')
const {
  webpack
} = new TransformPages()
module.exports = {
  configureWebpack: {
    plugins: [
      new webpack.DefinePlugin({
        ROUTES: webpack.DefinePlugin.runtimeValue(() => {
          const tfPages = new TransformPages({
            includes: ['path', 'name', 'menuId']
          });
          return JSON.stringify(tfPages.routes)
        }, true),
        TABBAR: webpack.DefinePlugin.runtimeValue(() => {
          return JSON.stringify(getTabBar.tabBar.list)
        }, true)
      })
    ]
  }
}
